//
//  DataManager.m
//  mhome
//
//  Created by YaSha_Tom on 2018/12/5.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "DataManager.h"
#import <MJExtension.h>
#import "IntentionListModel.h"
#import "IntentionLookModel.h"
#import "OrderListModel.h"
#import "OrderLookModel.h"
#import "ContractModel.h"
//#import "orderModel.h"
//#import "ProjectListModel.h"
//#import "ProjectInfoModel.h"
//#import "ProjectPeopleModel.h"
//#import "PersonModel.h"

@implementation DataManager

static DataManager *_datamanager = nil;
+ (DataManager *)sharedDataManager {
    
    if (!_datamanager) {
        
        _datamanager = [[DataManager alloc] init];
    }
    
    return _datamanager;
}
+ (NSArray *)getIntentionListData:(id)response {
    NSArray *intentionArray = response[@"data"][@"rows"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in intentionArray) {
        //字典转model的第三方MJExtension
        IntentionListModel *model = [IntentionListModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
+ (NSArray *)getIntentionLookData:(id)response {
   NSDictionary *intentionLooKDic = response[@"data"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    
        //字典转model的第三方MJExtension
    IntentionLookModel *model = [IntentionLookModel mj_objectWithKeyValues:intentionLooKDic];
    [mutableArray addObject:model];
    return [mutableArray copy];
}
+ (NSArray *)getOrderListData:(id)responseObject {
    NSArray *orderArray = responseObject[@"data"][@"rows"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in orderArray) {
        //字典转model的第三方MJExtension
        OrderListModel *model = [OrderListModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
+ (NSArray *)getOrderLookData:(id)response {
    NSDictionary *intentionLooKDic = response[@"data"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    
    //字典转model的第三方MJExtension
    OrderLookModel *model = [OrderLookModel mj_objectWithKeyValues:intentionLooKDic];
    [mutableArray addObject:model];
    return [mutableArray copy];
}
+ (NSArray *)getContractListData:(id)response {
    NSArray *orderArray = response[@"data"][@"rows"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in orderArray) {
        //字典转model的第三方MJExtension
        ContractModel *model = [ContractModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
+ (NSArray *)getContractLookData:(id)response{
    NSDictionary *intentionLooKDic = response[@"data"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    
    //字典转model的第三方MJExtension
    ContractModel *model = [ContractModel mj_objectWithKeyValues:intentionLooKDic];
    [mutableArray addObject:model];
    return [mutableArray copy];
}
//
//+ (NSArray *)getPMSInfoListData:(id)response {
//    NSMutableArray *mutableArray = [NSMutableArray array];
//    if (![response[@"data"] isEqual:[NSNull null]]) {
//        for (NSDictionary *dic in response[@"data"]) {
//            ProjectListModel *model = [ProjectListModel mj_objectWithKeyValues:dic];
//            [mutableArray addObject:model];
//        }
//    }
//    return [mutableArray copy];
//}
//+ (NSArray *)getPMSInfoData:(id)response {
//    NSDictionary *infoDic = response[@"data"];
//    NSLog(@"=====%@",infoDic);
//    NSMutableArray *mutableArray = [NSMutableArray array];
//        //字典转model的第三方MJExtension
//    ProjectInfoModel *model = [ProjectInfoModel mj_objectWithKeyValues:infoDic];
//    NSLog(@"---%@",model);
//    [mutableArray addObject:model];
//    return [mutableArray copy];
//}
//+(NSArray *)getPMSPeopleData:(id)response {
//    NSArray *orderArray = response[@"data"];
//    NSMutableArray *mutableArray = [NSMutableArray array];
//    for (NSDictionary *dic in orderArray) {
//        //字典转model的第三方MJExtension
//        ProjectPeopleModel *model = [ProjectPeopleModel mj_objectWithKeyValues:dic];
//        [mutableArray addObject:model];
//    }
//    return [mutableArray copy];
//}
//+(NSArray *)getPersonInfoData:(id)response {
//    NSDictionary *infoDic = response[@"data"];
//    NSLog(@"=====%@",infoDic);
//    NSMutableArray *mutableArray = [NSMutableArray array];
//    //字典转model的第三方MJExtension
//    PersonModel *model = [PersonModel mj_objectWithKeyValues:infoDic];
//    NSLog(@"---%@",model);
//    [mutableArray addObject:model];
//    return [mutableArray copy];
//}
@end
